<%@page import="java.net.URLDecoder"%>
<%@page import="org.apache.naming.java.javaURLContextFactory"%>
<%@page import="java.net.*,java.util.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>解析</title>
</head>
<body>
<% 
/*获取请求里包含的查询字符串  */
String rawquery=request.getQueryString();
   out.print(rawquery);
   
/*使用URLDecoder解码  */   
String querystr=URLDecoder.decode(rawquery,"UTF-8");
out.print(querystr);

/*分解得出参数名  */
String []namepairs=querystr.split("&");
 for(String paps:namepairs){
	
	String []vlues=paps.split("=");
	out.println(vlues[0]+"参数的值是"+vlues[1]+"<hr/>");
	
} 

/* for(int i=0;i<=namepairs.length-1;i++){
	
	out.println(namepairs[0]+"参数的值是"+namepairs[1]);
} */
   
%>
</body>
</html>